package com.cn.qtms.util.sms;//类注释设置模板

import com.cn.qtms.dto.SmsMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Name:SmsMessageSender 短信队列发送者 调用启用一次短信请求
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-12-01 13:14
 **/
@Slf4j
@Component
public class SmsMessageSender {

    @Autowired
    private RabbitTemplate template;

    public void sendMsg(SmsMessage msg){
        log.info("send sms message: "+msg.toString());
        template.convertAndSend("jixiang.sms", msg);
    }

}
